<?php
/**
 * @version     1.0.0
 * @package     com_igzclientes
 * @copyright   Copyright (C) 2012. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Created by com_combuilder - http://www.notwebdesign.com
 */

// no direct access
defined('_JEXEC') or die;

JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>
<link rel="stylesheet" href="<?php echo JURI::base();?>../media/system/css/modal.css" type="text/css" />
<style>
    .textareabox{
        width: 100%!important;
        height: 100px!important;
    }
</style>
<script src="<?php echo JURI::base();?>../media/system/js/modal.js" type="text/javascript"></script>

<script type="text/javascript">

function keepAlive() {	var myAjax = new Request({method: "get", url: "<?php echo JURI::base().'../';?>"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
		window.addEvent('domready', function() {

			SqueezeBox.initialize({});
			SqueezeBox.assign($$('a.modal-button'), {
				parse: 'rel'
			});
		});
			function isBrowserIE() {
				return navigator.appName=="Microsoft Internet Explorer";
			}

			function jInsertEditorText( text, editor ) {
				if (isBrowserIE()) {
					if (window.parent.tinyMCE) {
						window.parent.tinyMCE.selectedInstance.selection.moveToBookmark(window.parent.global_ie_bookmark);
					}
				}
				tinyMCE.execInstanceCommand(editor, 'mceInsertContent',false,text);
			}

			var global_ie_bookmark = false;

			function IeCursorFix() {
				if (isBrowserIE()) {
					tinyMCE.execCommand('mceInsertContent', false, '');
					global_ie_bookmark = tinyMCE.activeEditor.selection.getBookmark(false);
				}
				return true;
			}
		function jSelectArticle(id, title, catid, object, link, lang) {
			var hreflang = '';
			if (lang !== '') {
				var hreflang = ' hreflang = "' + lang + '"';
			}
			var tag = '<a' + hreflang + ' href="' + link + '">' + title + '</a>';
			jInsertEditorText(tag, 'jform_articletext');
			SqueezeBox.close();
		}
		window.addEvent('domready', function() {

			SqueezeBox.initialize({});
			SqueezeBox.assign($$('a.modal'), {
				parse: 'rel'
			});
		});
			function insertReadmore(editor) {
				var content = tinyMCE.get('jform_articletext').getContent();
				if (content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
					alert('There is already a Read more... link that has been inserted. Only one such link is permitted. Use {pagebreak} to split the page up further.');
					return false;
				} else {
					jInsertEditorText('<hr id="system-readmore" />', editor);
				}
			}
			
window.addEvent('domready', function(){ new Fx.Accordion($$('div#content-sliders-.pane-sliders > .panel > h3.pane-toggler'), $$('div#content-sliders-.pane-sliders > .panel > div.pane-slider'), {onActive: function(toggler, i) {toggler.addClass('pane-toggler-down');toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_content-sliders-',$$('div#content-sliders-.pane-sliders > .panel > h3').indexOf(toggler));},onBackground: function(toggler, i) {toggler.addClass('pane-toggler');toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if($$('div#content-sliders-.pane-sliders > .panel > h3').length==$$('div#content-sliders-.pane-sliders > .panel > h3.pane-toggler').length) Cookie.write('jpanesliders_content-sliders-',-1);},duration: 300,opacity: false,alwaysHide: true}); });
		window.addEvent('domready', function() {

			SqueezeBox.initialize({});
			SqueezeBox.assign($$('a.modal_jform_created_by'), {
				parse: 'rel'
			});
		});
	function jSelectUser_jform_created_by(id, title) {
		var old_id = document.getElementById("jform_created_by_id").value;
		if (old_id != id) {
			document.getElementById("jform_created_by_id").value = id;
			document.getElementById("jform_created_by_name").value = title;
			
		}
		SqueezeBox.close();
	}

	function jInsertFieldValue(value, id) {
		var old_id = document.id(id).value;
		if (old_id != id) {
			var elem = document.id(id);
			elem.value = value;
			elem.fireEvent("change");
		}
	}
window.addEvent('domready', function(){ new Fx.Accordion($$('div#permissions-sliders-.pane-sliders > .panel > h3.pane-toggler'), $$('div#permissions-sliders-.pane-sliders > .panel > div.pane-slider'), {onActive: function(toggler, i) {toggler.addClass('pane-toggler-down');toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_permissions-sliders-',$$('div#permissions-sliders-.pane-sliders > .panel > h3').indexOf(toggler));},onBackground: function(toggler, i) {toggler.addClass('pane-toggler');toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if($$('div#permissions-sliders-.pane-sliders > .panel > h3').length==$$('div#permissions-sliders-.pane-sliders > .panel > h3.pane-toggler').length) Cookie.write('jpanesliders_permissions-sliders-',-1);},duration: 300,opacity: false,alwaysHide: true}); });
window.addEvent('domready', function(){ new Fx.Accordion($$('div#permissions-sliders.pane-sliders .panel h3.pane-toggler'),$$('div#permissions-sliders.pane-sliders .panel div.pane-slider'), {onActive: function(toggler, i) {toggler.addClass('pane-toggler-down');toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_permissions-sliderscom_content',$$('div#permissions-sliders.pane-sliders .panel h3').indexOf(toggler));},onBackground: function(toggler, i) {toggler.addClass('pane-toggler');toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');}, duration: 300, display: 0, show: 0, alwaysHide:true, opacity: false}); });
  </script>
  


<script type="text/javascript" src="<?php echo JURI::base();?>../media/editors/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'cliente.cancel' || document.formvalidator.isValid(document.id('cliente-form'))) {
			Joomla.submitform(task, document.getElementById('cliente-form'));
		}
		else {
			alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
		}
	}
</script>

<script type="text/javascript">
tinyMCE.init({
        // General
        directionality: "ltr",
        editor_selector : "textareabox",
        language : "en",
        mode : "specific_textareas",
        skin : "default",
        theme : "advanced",
        // Cleanup/Output
        inline_styles : true,
        gecko_spellcheck : true,
        entity_encoding : "raw",       
        force_br_newlines : false, force_p_newlines : true, forced_root_block : 'p',
        invalid_elements : "script,applet,iframe",
        // URL
        relative_urls : true,
        remove_script_host : false,
        document_base_url : "<?php echo JURI::base();?>../",
        
        theme_advanced_buttons1 : "",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : ""
        
        
});
</script>

<form action="<?php echo JRoute::_('index.php?option=com_igzclientes&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="cliente-form" class="form-validate">
	<div class="width-60 fltlft">
		<fieldset class="adminform">
			<legend><?php echo JText::_('COM_IGZCLIENTES_LEGEND_CLIENTE'); ?></legend>
			<ul class="adminformlist">

            <!--
			<li><?php echo $this->form->getLabel('id'); ?>
			<?php echo $this->form->getInput('id'); ?></li>
			-->
            
			<li><?php echo $this->form->getLabel('nombres'); ?>
			<?php echo $this->form->getInput('nombres'); ?></li>

            
			<li>
				<div class="clr" style="height:30px;"></div>
				<?php echo $this->form->getLabel('imglogo'); ?>
				<div class="button2-left">
                    <div class="image">
                        <a rel="{handler: 'iframe', size: {x: 800, y: 500}}" onclick="IeCursorFix(); return false;" href="<?php echo JURI::base(); ?>/index.php?option=com_media&amp;view=images&amp;tmpl=component&amp;e_name=jform_imglogo&amp;asset=com_igzcasos&amp;author=" title="Seleccionar Imágen" class="modal-button">
                            Seleccionar Imágen
                        </a>
                    </div>
                </div>
                <div class="clr"></div> 

				<?php echo $this->form->getInput('imglogo'); ?>
				<div class="clr" style="height:20px;"></div>
			</li>

            

            

            </ul>
		</fieldset>
	</div>


	<input type="hidden" name="task" value="" />
	<?php echo JHtml::_('form.token'); ?>
	<div class="clr"></div>
</form>